package com.xmy.controller;

import com.xmy.api.IGoodsService;
import com.xmy.entity.Result;
import com.xmy.pojo.ShopGoods;
import com.xmy.pojo.ShopOrderGoodsLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.websocket.server.PathParam;

/**
 * @author wangjinlinag
 * @Classname GoodsController
 * @Description TODO
 * @Date 2021/5/12 3:42 下午
 */
@RestController
@RequestMapping
public class GoodsController {
    @Autowired
    private IGoodsService goodsService;

    @GetMapping("/goods/{id}")
    public ShopGoods findOne(@PathVariable("id")Long id){
        return goodsService.findOne(id);
    }

    @GetMapping("/goods/reduceGoodsNum")
    public Result reduceGoodsNum(@RequestBody ShopOrderGoodsLog orderGoodsLog){
        return goodsService.reduceGoodsNum(orderGoodsLog);
    }
}
